package com.spring.learn.controller;

import com.spring.learn.service.NoAnnoService;
import com.spring.learn.service.UserService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by baiguantao on 2017/4/24.
 */
/*@PropertySource("classpath:/jdbc2.properties")*/
@Controller
@RequestMapping(value = {"/index2"})
public class TestBeanScopeController implements InitializingBean{

    @Autowired
    private UserService userService;
    @Autowired
    private NoAnnoService ricky;
    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("我执行了吗？bean的范围");
        System.out.println(userService.toString());
        System.out.println(ricky.toString());
    }
}
